Mapping source tables to Data Hub models
Data Hub target is an Early Access release. Refer to the Early Access disclaimer for details.
Each table in a Data Hub target data flow maps its columns to fields in one target model. Data Integration maps columns by name and checks their types. You match each source column to a target field in the selected Data Hub model, set the match key, and change any mapping that the automatic mapping does not get right. You cannot change data types in the mapping.
Prerequisites
- The data flow has a selected Data Hub contributor source and a target model for each table. For more information, refer to Configuring Data Hub as a target.
Open the mapping for a table
- On the Configure schema step, select the table.
- Select a Target Model from the drop-down list. The field is marked in red until you select a model.
- Open the mapping dialog. It lists every source column with its target field, type, and mode.
- Select the source columns to load. Columns are not selected automatically. For each column you want to load, select a target field in the selected Data Hub model to match the source column.
For a custom query, select Run Mapping to fetch the column definitions. The columns then appear in the mapping dialog.
Set the match key
The match key identifies each row in the table. Data Integration pre-selects the primary key columns from the source table. To change the match key, use the key icon in the mapping dialog. You can also filter the dialog to Match Key to see only the key columns.
Every table needs at least one match key column. This applies to custom query and multi-table flows as well. To use a composite key, select several key columns. Data Integration combines them into one entity ID:
- The values are joined with an underscore (
_), sorted alphabetically by column name. For example, the keysz_idanda_idproduce<a_id>_<z_id>. - The entity ID holds only the key values. It does not include the source name, table name, or connection ID.
- The entity ID can be up to 255 characters. A longer ID stops the load with an error.
The entity ID is built from the match key and is not shown in the user interface. A source column named id is not mapped to the Data Hub entity ID. Map it to a model field, or clear it.
Rows with a null value in any key column are rejected and reported. If the same key value appears more than once in a run, the last row wins.
Map columns to model fields
- Review each automatically mapped column. Auto-mapping matches a column to a field with the same name, ignoring case and a leading
full_. It maps a column only when the types are compatible. - For each column that needs a decision, select a Target Field. To leave a column out, clear its check box or select Not mapped.
- Check the labels in the Mode column. A required field shows an asterisk (
*). A field used in a match rule shows a Match rule label. The labels are informational and do not block saving.
A manual mapping to an incompatible field shows a type error. The table is marked Incomplete, and you cannot save until you fix the mapping or unmap the column.
Data Hub manages the created and updated dates of golden records. They are not in the default mapping. To load source timestamps, define fields for them in the model.
Data Integration does not support calculated target columns. To load a calculated value, calculate it on the source side, for example in a view or custom query, and map the result to a model field.
Map field groups
A field group appears in the Target Field list as one item, named by its top-level name, such as Contacts (repeatable). The child fields of the group also appear when you select a column. Map either the top-level group or its child fields, not both. If you map a top-level group to one column and one of its nested fields to another column, the data flow fails to activate.
Map a field group to a column that holds the group's data:
- For a Data Hub source, map the source field group to the target field group with the same name.
- For other sources, map a JSON, object, VARIANT, STRUCT, OBJECT, RECORD, or SUPER column. A STRING that holds JSON also works. For a repeatable group, the column must hold an array of objects. Each array element becomes one item in the group.
- An array of scalar values maps to a repeatable single field, also called a List field.
These rules apply:
- A scalar column, such as a string, cannot map to a field group. The row shows an error.
- An array or repeatable column cannot map to a non-repeatable group. The row shows an error.
- A single object mapped to a repeatable group is sent as a one-item collection.
- A repeatable group cannot contain another repeatable group.
- If the column is null, empty, or an empty array, Data Integration does not send the group. The collection in Data Hub stays unchanged.
- Data Integration does not check the values inside a group. Data Hub rejects or quarantines records with missing or invalid child values.
Relational child tables with one row for each child, such as customer_contact with customer_id, email, and phone columns, cannot map to a field group. Create a view or custom query that aggregates the child rows into a JSON array for each parent record. This works for standard extraction only, because CDC reads tables.
Set the collection write mode
A collection is a repeatable field group or a List field. If the table maps a collection, the Table Target Settings tab shows the Loading Mode (For Collections fields) setting. Select Upsert Merge (default) or Overwrite (Replace Items).
For more information about merge behavior, refer to Upsert-merge method overview. For more information about each mode, refer to Collection write modes.
Validation rules
Data Integration does not show warnings for mapping. Only blocking errors stop you from saving or activating. Saving is blocked when:
- No Data Hub contributor source is selected.
- A table has no target model, or the selected model is not attached to the selected source.
- A table has no match key column.
- A mapped column has an incompatible type. For example, a scalar column is mapped to a field group, or an array is mapped to a non-repeatable group.
- A mapped column has a case-only twin among the selected source columns. For example,
NameandNAME. This applies even when one name matches the model field exactly. Data Integration does not guess between them. - A selected source column does not have a target field.
Case-only twins that are not selected are ignored. Column names that differ only by case cannot be loaded together. Keep one column from each group, or rename the others in a view or custom query.
Resolve Incomplete status
The Status column shows Live when a table is ready, Incomplete when a required item is missing or a mapping is broken, and Excluded when the table is not included. Select Incomplete to open the table's mapping dialog with the missing item highlighted. The tooltip names the missing item, such as the target model, match key, unmapped required field, or type mismatch.
Save is blocked until every included table is Live.
Check quarantined records
The run summary reports quarantined records with a link to Data Hub. A record quarantined for a missing required field can be resubmitted from Data Hub after another source has created the golden record. A record quarantined for a missing match-rule field cannot be fixed by resubmitting. Correct the source data, then run the data flow again. A record quarantined because of an unresolved reference resolves automatically when the referenced record arrives.
For more information about quarantine, refer to Quarantines in the Data Hub documentation.